package org.zlb.manager.entity;

import javax.persistence.*;
import java.util.Arrays;
import java.util.Objects;

/**
 * TODO
 *
 * @author zhoulingbo
 * @date 2021/8/18 15:46
 */
@Entity
@Table(name = "fun_avatar", schema = "admin", catalog = "")
public class FunAvatar {
    private long avatarId;
    private byte avatarType;
    private long avatarTime;
    private byte[] avatar50;
    private byte[] avatar100;
    private byte[] avatar150;

    @Id
    @Column(name = "AVATAR_ID")
    public long getAvatarId() {
        return avatarId;
    }

    public void setAvatarId(long avatarId) {
        this.avatarId = avatarId;
    }

    @Basic
    @Column(name = "AVATAR_TYPE")
    public byte getAvatarType() {
        return avatarType;
    }

    public void setAvatarType(byte avatarType) {
        this.avatarType = avatarType;
    }

    @Basic
    @Column(name = "AVATAR_TIME")
    public long getAvatarTime() {
        return avatarTime;
    }

    public void setAvatarTime(long avatarTime) {
        this.avatarTime = avatarTime;
    }

    @Basic
    @Column(name = "AVATAR_50")
    public byte[] getAvatar50() {
        return avatar50;
    }

    public void setAvatar50(byte[] avatar50) {
        this.avatar50 = avatar50;
    }

    @Basic
    @Column(name = "AVATAR_100")
    public byte[] getAvatar100() {
        return avatar100;
    }

    public void setAvatar100(byte[] avatar100) {
        this.avatar100 = avatar100;
    }

    @Basic
    @Column(name = "AVATAR_150")
    public byte[] getAvatar150() {
        return avatar150;
    }

    public void setAvatar150(byte[] avatar150) {
        this.avatar150 = avatar150;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FunAvatar funAvatar = (FunAvatar) o;
        return avatarId == funAvatar.avatarId &&
                avatarType == funAvatar.avatarType &&
                avatarTime == funAvatar.avatarTime &&
                Arrays.equals(avatar50, funAvatar.avatar50) &&
                Arrays.equals(avatar100, funAvatar.avatar100) &&
                Arrays.equals(avatar150, funAvatar.avatar150);
    }

    @Override
    public int hashCode() {
        int result = Objects.hash(avatarId, avatarType, avatarTime);
        result = 31 * result + Arrays.hashCode(avatar50);
        result = 31 * result + Arrays.hashCode(avatar100);
        result = 31 * result + Arrays.hashCode(avatar150);
        return result;
    }
}
